<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        // es6 允许试用箭头函数（=>）定义函数
        // let fn = function (){

        // }
        let fn = (a,b) =>{
            return a+b;
            }
        fn(1,2);

        // this 是静态的 this 始终指向函数声明时所在作用域下的 this 的值
        function getName() {
            console.log(this.name);
        }
        let getName2 = () => {

            console.log(this.name);
        }
        window.name = '赵哲';
        const school = {
            name : 'zhaozhe'
        }

        getName()
        getName2()
         
        getName.call(school)
        getName2.call(school)
    </script>
</body>
</html>